Skip to content

navmap_tools: buildings from the Catastro / OpenStreetMap, and large NavMaps of a place - #45

Open
jmguerreroh wants to merge 1 commit into
EasyNavigation:rollingfrom
jmguerreroh:navmap-tools-buildings
Open

jmguerreroh wants to merge 1 commit into
EasyNavigation:rollingfrom
jmguerreroh:navmap-tools-buildings

Conversation

@jmguerreroh

@jmguerreroh jmguerreroh commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

navmap_tools: buildings from the Catastro / OpenStreetMap, and large NavMaps of a place

Branch base: rolling. Files: navmap_tools only (and its section of the README). Independent of
the navmap_core simplify PR; neither needs the other.

What it takes to get a NavMap of a real city: the ground from a DEM, without the buildings, at a
size the Python --navmap sampling cannot reach (2 x 2 km around the Puerta del Sol at 0.5 m is
16 M cells and 13.8 M NavCels).

navmap_gis_tool

  • --buildings {auto,catastro,osm} (geo/buildings.py): the footprints of the buildings, and
    every cell any part of a building is in left without ground (patios stay ground).
    • catastro: the Spanish Catastro's INSPIRE WFS (BU:BuildingPart with floors above the
      ground; underground parts are left out), asked by tiles of 800 m. A tile the service keeps
      failing on is retried with backoff and asked in four (twice); where it still answers an error
      page for the building parts (it happens in some places of Madrid), the whole buildings
      (BU:Building) are asked instead: the footprints, without the floors.
    • osm: OpenStreetMap through Overpass (building=*, except no, roof and carport, which
      are no obstacle at ground level).
    • auto: the Catastro in Spain, OpenStreetMap elsewhere or where the Catastro has none.
    • Every answer is cached on disk (--cache-dir).
  • --navmap-out FILE (geo/dem_navmap.py): the local height grid as a NavMap, two NavCels per
    cell with ground, without the cells that have none (--buildings, --dem-holes-mesh) or are
    steeper than --max-slope-deg; vertex colours with --dem-imagery. Vectorised: the 13.8 M
    NavCels above take 6 min (most of it the download) and 3 GB.
  • --dem-holes-mesh also works with --navmap-out.
ros2 run navmap_tools navmap_gis_tool --center 40.41690,-3.70350 --size 2000 --resolution 0.5 \
  --dem-source ign --buildings auto --navmap-out sol_0.5m.navmap

Tests

New tests for the footprints (cells inside a
building, its edges, its patios, footprints beyond the grid), the Catastro answer in the local
frame (underground parts left out), the OpenStreetMap fallback, the whole-buildings fallback, the
DEM-to-NavMap conversion (holes, slopes, colours) and the CLI options. No network involved: the
answers are canned.

colcon test --packages-select navmap_tools on this branch: 595 tests (with the linters), no
failures.

…NavMaps of a place

navmap_gis_tool:
- --buildings {auto,catastro,osm}: downloads the footprints of the buildings (the Catastro
  INSPIRE WFS in Spain, by tiles, retried with backoff, split in four when the service keeps
  failing and, where it still fails on the building parts, asked for the whole buildings;
  OpenStreetMap through Overpass elsewhere or where the Catastro has none) and leaves without ground every
  cell any part of a building is in; patios stay ground. Answers are cached on disk.
- --navmap-out FILE: the local height grid as a NavMap, two NavCels per cell with ground,
  without the cells that have none (--buildings, --dem-holes-mesh) or are steeper than
  --max-slope-deg; vertex colours with --dem-imagery. Vectorised (tens of millions of cells),
  unlike --navmap, whose sampling loop is pure Python.
- --dem-holes-mesh now also works with --navmap-out.
@jmguerreroh
jmguerreroh force-pushed the navmap-tools-buildings branch from 004fc8a to 45bd828 Compare November 17, 2026 14:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant